/*
 * Copyright (c) 2010 CCX(China) Co.,Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * CCX(China) Co.,Ltd. ("Confidential Information").
 * It may not be copied or reproduced in any manner without the express 
 * written permission of CCX(China) Co.,Ltd.
 *
 * Author: zhnb
 * Date: 2011-7-15 上午09:18:50
 */
package event.active;

import java.io.Serializable;

import event.MyEventSource;
import event.MyListener;

/**
 * 测试主类
 * @author zhnb
 *
 */
public class StartMain implements Serializable {

    private static final long serialVersionUID = -2151992428030293146L;

    public static void main(String[] args) {
        
        // 事件源
        MyEventSource myEventSource01 = new MyEventSource();
        MyEventSource myEventSource02 = new MyEventSource();
        
        // 监听者
        MyListener myListener01 = new MyListener();
        MyListener myListener02 = new MyListener();
        
        // 添加监听者到事件源
        myEventSource01.addListener(myListener01);
        myEventSource01.addListener(myListener02);
        
        myEventSource02.addListener(myListener01);
        
        // 触发事件
        System.out.println("============*============");
        myEventSource01.setName("111");
        // 重复时不触发
        System.out.println("===========***===========");
        myEventSource01.setName("111");
        // 触发事件
        System.out.println("============*============");
        myEventSource01.setName("222");
        
        System.out.println("============*============");
        myEventSource02.setName("222");
        
    }

}
